
//统一管理所有api

import request from './request'
// 按需导出

//请求首页数据
export const getHomeData = () => request.get('/index/index')
//品牌详情
export const getBrandDetail = (params) => request.get('/brand/detail', { params });
//品牌详情下的产品列表
export const getBrandGoodsList = (params) => request.get('/goods/list', { params });
//分类页面右侧数据获取
export const getCateData = (params) => request.get('/goods/category', { params });
//请求弹出层数据
export const getPopupData = () => request.get('/search/index');

//请求实时搜索数据
export const getTimeData = (params) => request.get('/search/helper', { params });

//商品框商品搜索数据
export const getGoodsData = (params) => request.get('/goods/list', { params });
//清空历史记录
export const clearHistoryData = () => request.post('search/clearhistory');
//用户登录
export const userLogin = (params) => request.post('/auth/loginByWeb', params);

//获取全部分类数据
export const getCategoryData = () => request.get('/catalog/index');
//获取当前分类数据
export const getCurrentCategoryData = (params) => request.get('/catalog/current', { params });

//获取专题页面数据
export const getTopicData = (params) => request.get('/topic/list', { params });
//获取分类页面商品列表数据
export const getGoodsListData = (params) => request.get('/goods/list', { params });
//获取商品详情数据
export const getGoodsDetailData = (params) => request.get('/goods/detail', { params });
//获取某商品下的相关产品数据
export const getRelatedData = (params) => request.get('/goods/related', { params });
//获取购物车产品数量
export const getGoodsCount = () => request.get('/cart/goodscount');
//加入购物车
export const addToCart = (params) => request.post('/cart/add', params);
//获取购物车数据
export const getCartData = () => request.get('/cart/index');

//点击切换商品选中状态
export const toggleCheckedStatus = (params) => request.post('/cart/checked', params);
//点击修改商品数量
export const updataGoodsNumber = (params) => request.post('/cart/update', params);
//删除商品
export const delGoods = (params) => request.post('/cart/delete', params);